import { buildCategoryTree } from './buildCategoryTree'

self.addEventListener('message', e => {
  const categoryList = JSON.parse(e.data)
  const tree = buildCategoryTree(categoryList)
  postMessage(tree)
})